﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" Theme="Admin" AutoEventWireup="true" CodeFile="manage-posts.aspx.cs" Inherits="admin_ManagePosts" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="body" Runat="Server">
	<h1>Posts</h1>
	<asp:GridView ID="postsGrid" runat="server" Width="100%" DataKeyNames="Id" 
		onrowdeleting="postsGrid_RowDeleting">
		<Columns>
			<asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
			<asp:TemplateField HeaderText="When" SortExpression="DateCreated">
				<ItemTemplate>
					<asp:Label ID="Label1" runat="server" Text='<%# Bind("DateCreated", "{0:d}<br />{0:t}") %>'></asp:Label>
				</ItemTemplate>
			</asp:TemplateField>
			<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
			<asp:BoundField DataField="Keywords" HeaderText="Keywords" SortExpression="Keywords" />
			<asp:BoundField DataField="CommentCount" HeaderText="Comments" SortExpression="CommentCount" />
			<asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
			<asp:HyperLinkField DataNavigateUrlFields="PermaLink" DataNavigateUrlFormatString="{0}" ShowHeader="False" Text="View" >
				<ItemStyle CssClass="row-button" />
			</asp:HyperLinkField>
			<asp:HyperLinkField DataNavigateUrlFields="Id" DataNavigateUrlFormatString="post.aspx?id={0}" ShowHeader="False" Text="Edit" >
				<ItemStyle CssClass="row-button" />
			</asp:HyperLinkField>
			<asp:CommandField ShowDeleteButton="True" >
				<ItemStyle CssClass="row-button" />
			</asp:CommandField>
		</Columns>
	</asp:GridView>
	
	<asp:HyperLink ID="backwardLink" runat="server" CssClass="page-backward" Text="Back" Visible="false" />
	<asp:HyperLink ID="forwardLink" runat="server" CssClass="page-forward" Text="Next" Visible="false" />
</asp:Content>

